-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix spectral extraction previews on unit change #3157
Conversation
flux_unit = Unicode().tag(sync=True) | ||
sb_unit = Unicode().tag(sync=True) | ||
flux_units = Unicode().tag(sync=True) | ||
sb_units = Unicode().tag(sync=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be consistent with the traitlets above, I was confusing myself when writing code later in the plugin and having to switch between singular and plural
@@ -542,7 +545,9 @@ def _preview_x_from_extracted(self, extracted): | |||
return extracted.spectral_axis.value | |||
|
|||
def _preview_y_from_extracted(self, extracted): | |||
return extracted.flux.value | |||
# TODO: use extracted's PIXAR_SR instead (but for some reason isn't populated here...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does anyone know why this is (I'm guessing its just populated later when actually loading into the app)? Ultimately, I think the extracted spectrum just gets a copy of PIXAR_SR from the input cube, so this shouldn't matter, it just would read more cleanly if it did.
56ed577
to
67df70a
Compare
It seems like changing to flux makes the preview disappear (as expected, I think), but then changing back to surface brightness doesn't trigger the preview to reappear. It only comes back if you then change the flux unit while in surface brightness mode. |
is it possible that its timing out? Do you get the warning that the previews have been disabled? |
The previews disabled warning does not appear, I do see the warning about the display units (surface brightness vs flux). And now that I think about it, I guess the preview should show up when flux is selected in unit conversion. It doesn't seem to be timing out. I was able to get the preview to show this time. You can see that at first it flickered and then disappeared when I switched to flux, and when I changed units (the second time?) it stuck around: Screen.Recording.2024-08-21.at.4.52.46.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you load in a surface brightness cube, the automatic sum extraction is plotted in the spectral viewer and the spectral y axis correctly says flux, however in the unit conversion app the toggle is set to 'surface brightness', i don't see this on main
7b7d1a7
to
8149cf4
Compare
8149cf4
to
5c781f1
Compare
@cshanahan1 - I think this is fixed now after a rebase, but please confirm if you have a second to test. |
(still working on some cases where the preview is not showing after the rebase) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3157 +/- ##
==========================================
+ Coverage 88.46% 88.47% +0.01%
==========================================
Files 125 125
Lines 18677 18700 +23
==========================================
+ Hits 16522 16545 +23
Misses 2155 2155 ☔ View full report in Codecov by Sentry. |
5c781f1
to
9e56b9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to work as intended - I can't convert to erg/s/cm2/a but i think that will be fixed by mine and @pllim PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me now, thanks.
Description
This pull request updates the spectral extraction live-preview for any change that affects the y-units of the extracted spectrum or spectral viewer (and also ensures the internal units in the plugin are populated for the warning banner introduced in #3143 which was recently broken).
Screen.Recording.2024-08-19.at.2.28.41.PM.mov
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.